package com.web.main.entity.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @create 2020-11-26 16:50
 */
@Data
public class SiteQuery implements Serializable {
    private static final long serialVersionUID = 9043468058846811696L;

    @ApiModelProperty(value = "当前页", required = true, example = "1")
    @NotNull(message = "当前页不能为空")
    private Integer page;

    @ApiModelProperty(value = "当前页记录条数", required = true, example = "4")
    @NotNull(message = "当前页记录条数不能为空")
    private Integer limit;

    @ApiModelProperty(value = "充电站名字（模糊）")
    @Size(max = 20, message = "充电站名字最长为{max}为")
    private String siteName;

    @ApiModelProperty(value = "站点和用户的距离")
    @NotNull(message = "站点和用户距离不为空，应该有个默认值")
//    @Pattern(regexp = "^[1-40]$", message = "站点和用户距离在1~40km范围内")
    @Min(value = 1, message = "站点和用户距离在1~40km范围内")
    @Max(value = 40, message = "站点和用户距离在1~40km范围内")
    private Integer distance;

    @ApiModelProperty(value = "供应商名字（条件）")
    @Size(max = 15, message = "名字最长{max}个字符")
    private String supplierName;

    @ApiModelProperty(value = "电桩类型（0：国际、1：特斯拉，默认0）")
//    @Pattern(regexp = "^[0-1]$", message = "请选择电桩类型：0:国际/1:特斯拉")
    @Min(value = 0, message = "请选择电桩类型：0:国际/1:特斯拉")
    @Max(value = 1, message = "请选择电桩类型：0:国际/1:特斯拉")
    private Integer pileType;

    @ApiModelProperty(value = "电桩型号（0：快充、1：慢充，默认0）")
//    @Pattern(regexp = "^[0-1]$", message = "请选择0:快充/1:慢充")
    @Min(value = 0, message = "请选择0:快充/1:慢充")
    @Max(value = 1, message = "请选择0:快充/1:慢充")
    private Integer pileModel;

    @ApiModelProperty(value = "停车场地（0：地上，1：地下，默认0）")
//    @Pattern(regexp = "^[0-1]$",  message = "请选择0:地上/1:地下")
    @Min(value = 0,  message = "请选择0:地上/1:地下")
    @Max(value = 1,  message = "请选择0:地上/1:地下")
    private Integer sitePlace;

    @ApiModelProperty(value = "是否24小时营业（0：是，1：否，默认0）")
//    @Pattern(regexp = "^[0-1]$", message = "请选择0:是/1:否")
    @Min(value = 0, message = "请选择0:是/1:否")
    @Max(value = 1, message = "请选择0:是/1:否")
    private Integer siteAllday;


    @ApiModelProperty(value = "经度", required = true)
    @NotEmpty(message = "经度不能位空")
    private String longitude;

    @ApiModelProperty(value = "纬度", required = true)
    @NotEmpty(message = "纬度不能位空")
    private String dimension;
}
